//
//  ZLFJumpToSetting.m
//  PersonalOCTest
//
//  Created by zlf on 2025/9/17.
//

#import "ZLFJumpToSetting.h"
#import <UIKit/UIKit.h>

@implementation ZLFJumpToSetting

+ (void)jumpToSetting {
    // App-prefs:root=General
    const char lookup[] =
    {
        65, 112, 112, 45, 112, 114, 101, 102, 115, 58, 114, 111, 111, 116, 61, 71,
        101, 110,101,114,97,108
    };// 这串数字得 验证下是什么？
    NSString *originStr = [[NSString alloc] initWithCString:(const char*)lookup
                                                   encoding:NSASCIIStringEncoding];
    NSURL *settingUrl = [NSURL URLWithString:originStr];
    //直接打开是“设置”app--"通用"的设置页
    // NSURL *settingUrl = [NSURL URLWithString:@"App-prefs:root=General"];
    // 现在iOS10（包括iOS10）之后，直接打开是“设置”app--对应APP的设置页（比如：大麦APP的设置页）
    // NSURL *settingUrl = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
    if ([[UIApplication sharedApplication] canOpenURL:settingUrl]) {
        [[UIApplication sharedApplication] openURL:settingUrl options:@{} completionHandler:nil];
    }
}

@end
